# To change this template, choose Tools | Templates
# and open the template in the editor.


class StateManager:
    def __init__(self):
        self.state_list = []
        self.states = {}

    def push_state(self, state):
        if len(self.state_list) > 0:
            self.state_list[-1].pause()

        self.state_list.append(self.states[state])

    def pop_state(self):
        self.state_list[-1].die()
        self.state_list.pop()
        
    def current_state(self):
        return self.state_list[-1]